@extends('layouts.admin')
@section('content')

    <!--Side menu and right menu -->

    <!-- main content -->
    <section class="content home">
        <div class="container-fluid">
            <div class="block-header">
                <h2>系统设置</h2>
                <ol class="breadcrumb">
                    <li><a href="/admin">首页</a></li>
                    <li><a href="/admin/article">系统设置</a></li>
                    <li><a href="/admin/apage">站点信息</a></li>
                    <li class="active">编辑站点信息</li>
                </ol>
            </div>

            <div class="row clearfix">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="card">
                        <div class="header">
                            <h2>  </h2>
                            <ul class="header-dropdown m-r--5">
                                <a href="{{ url()->previous() }}" title="返回上一页"> <i
                                            class="material-icons">arrow_back</i>
                                </a>

                                </li>
                            </ul>
                        </div>
                        <div class="body">
                            <form method="POST" action="">
                                <input type="hidden"  value="1" name="apage_id">
                                {{ csrf_field() }}
                                <label for="site_name">站点名称</label>
                                <div class="form-group">
                                    <div class="form-line">
                                        <input type="text" id="site_name" class="form-control" name="site_name" maxlength="150" value="{{$apage->site_name}}">
                                    </div>
                                    @if ($errors->has('site_name'))
                                        <label id="name-error" class="error" for="apage_title">{{ $errors->first('site_name') }}</label>
                                    @endif

                                </div>
                                <label class="control-label" for="keywords">关键字</label>
                                <div class="form-group ">
                                    <div class="form-line">
                                        <input type="text" id="keywords" class="form-control" name="keywords" value="{{$apage->keywords}}" maxlength="150">
                                    </div>
                                </div>
                                <label class="control-label" for="icp">备案编号</label>
                                <div class="form-group ">
                                    <div class="form-line">
                                        <input type="text" id="icp" class="form-control" name="icp" value="{{$apage->icp}}" maxlength="150">
                                    </div>
                                </div>
                                <label class="control-label" for="icpLink">备案链接</label>
                                <div class="form-group ">
                                    <div class="form-line">
                                        <input type="text" id="icpLink" class="form-control" name="icpLink" value="{{$apage->icpLink}}" maxlength="150">
                                    </div>
                                </div>
                                <label class="control-label" for="desc">站点描述</label>
                                <div class="form-group ">
                                    <div class="form-line">
                                        <textarea id="desc" class="form-control" name="desc" rows="3" aria-required="true"> {{$apage->desc}}</textarea>
                                    </div>
                                </div>
                                <label class="control-label" for="statistics_code">第三方流量统计代码</label>
                                <div class="form-group ">
                                    <div class="form-line">
                                        <textarea id="statistics_code" class="form-control" name="statistics_code" rows="3" aria-required="true"> {{$apage->statistics_code}}</textarea>
                                    </div>
                                </div>
                                <div class="hidden-print">
                                    <div class="pull-right">
                                        <button type="reset" class="btn  btn-raised bg-grey waves-effect">重置内容</button>
                                        <button type="submit" class="btn  btn-raised btn-success waves-effect">更新单页
                                        </button>

                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>


            </div>
        </div>
    </section>

@endsection
@push('header-css')
    <link href="{{ asset('assets/plugins/redactor2/redactor.css') }}" rel="stylesheet">
@endpush

@push('scripts')
   <script type="text/javascript" charset="utf-8" src="{{ asset('assets/plugins/redactor2/redactor.min.js')}}"></script>

   <script type="application/javascript">
        $(function ($) {
            $('#statistics_code,#desc').redactor({
                plugins:['source','table','fontcolor','fontsize','inlinestyle','fullscreen'],
                buttons: ['format', 'bold', 'italic', 'deleted', 'lists', 'image', 'file', 'link', 'horizontalrule' ,'horizontalrule', 'underline', 'ol', 'ul', 'indent', 'outdent'], // +
                minHeight: "300px",
                maxHeight: "500px",
                imageUploadParam:'imageFile',
                fileUploadParam:'imageFile',
                imageUpload: '{{Route('admin.upload.images')}}',
                placeholder: '请输入内容.....',
                X_CSRF_TOKEN:'{{csrf_token()}}',
            });
        });
    </script>
@endpush